import functools

import datetime

def func():
    print('func')




def decorator(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        print('wrapper of decorator')
        print(func._name_)
        return func(*args, **kwargs)
    return wrapper

#print(decorator(func))

#print(func.__name__)

def log(func):
    def wrapper(*args, **kw):
        print('call %s():' % func.__name__)
        return func(*args, **kw)
    return wrapper
@log
def now():
    print('hello')


def log2(*text):
    def decorator(func):
        #@functools.wraps(func)
        def wrapper(*args, **kw):
            print('%s %s():' % (text, func.__name__))
            return func(*args, **kw)
        return wrapper
    return decorator

@log2('execute')
def now2():
    print('hello')

now2()


